package cn.tedu.eb_film.pojo.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.time.LocalDateTime;

/**
 * 电影表的实体类
 *
 * @author daiojie
 *  * @version 0.0.1
 */
@Data
public class Movie implements Serializable {

    /**
     * 电影id
     */
    @ExcelProperty(index = 0,value = "电影id")
    private Long id;

    /**
     * 电影中文名
     */
    @ExcelProperty(index = 1,value = "电影中文名")
    private String znName;

    /**
     * 电影英文名
     */
    @ExcelProperty(index = 2,value = "电影英文名")
    private String enName;

    /**
     * 语言版本
     */
    @ExcelProperty(index = 3,value = "语言版本")
    private String languageVersion;

    /**
     * 空间效果
     */
    @ExcelProperty(index = 4,value = "空间效果")
    private String dimension;
    /**
     * 演职人员
     */
    @ExcelProperty(index = 5,value = "演职人员")
    private String actor;

    /**
     * 导演
     */
    @ExcelProperty(index = 6,value = "导演")
    private String director;

    /**
     * 电影详情
     */
    @ExcelProperty(index = 7,value = "电影详情")
    private String detail ;

    /**
     * 电影时长
     */
    @ExcelProperty(index = 8,value = "电影时长")
    private Long duration;

    /**
     * 电影类型
     */
    @ExcelProperty(index = 9,value = "电影类型")
    private String  type;

    /**
     * 电影评分
     */
    @ExcelProperty(index = 10,value = "电影评分")
    private BigDecimal score;

    /**
     * 电影票房
     */
    @ExcelProperty(index = 11,value = "电影票房")
    private Long boxOffice;

    /**
     * 观看人数
     *
     */
    @ExcelProperty(index = 12,value = "观看人数")
    private Long numberViewers;

    /**
     * 评论人数
     */
    @ExcelProperty(index = 13,value = "评论人数")
    private Long commentCount;

    /**
     * 上映时间
     */
    @ExcelProperty(index = 14,value = "上映时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss",shape = JsonFormat.Shape.STRING)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime releaseDate;

    /**
     * 制作地区
     */
    @ExcelProperty(index = 15,value = "制作地区")
    private String country;

    /**
     * 电影海报
     */
    @ExcelProperty(index = 16,value = "电影海报")
    private String pictureUrl;

    /**
     * 预告片
     */
    @ExcelProperty(index = 17,value = "预告片")
    private String trailerUrl;

    /**
     * 电影状态
     */
    @ExcelProperty(index = 18,value = "电影状态")
    private Integer state;

    /**
     * 想看人数
     */
    @ExcelProperty(index = 19,value = "想看人数")
    private Long numberWantToSee;

    /**
     * 收藏的人数
     */
    @ExcelProperty(index = 20,value = "收藏的人数")
    private Long collectUserCount;

    /**
     * 创建时间
     */
    @ExcelProperty(index = 21,value = "创建时间")
    @ExcelIgnore
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ExcelProperty(index = 22,value = "更新时间")
    @ExcelIgnore
    private LocalDateTime updateTime;
}
